The development of most computer programs requires writing code in a high level language, checking the code to ensure it faithfully reflects the underlying algorithm, and translating the code into equivalent machine instructions. The machine instructions direct a computer to perform the computation specified by the original program. Numerous tools aid the development of programs. For example, editors simplify searching and manipulating code specified in high-level languages. Compilers check the syntax of code written in high level languages and translate code into machine-executable form. Integrated development environments (IDEs) facilitate the efficient production of code. An IDE provides a single user interface having many of the tools that are required throughout the software development cycle. Most IDEs have an editor, a compiler, and a debugger integrated into a single user interface. Each of these development tools can be controlled from within the IDE.
While the aforementioned development tools simplify writing, compiling, and debugging code, they largely ignore an aspect of software development that programmers would like to control: specifying in detail and in a convenient way how software should be implemented at the machine level.
Some tools support global control of implementation such as “optimize code for speed” or “suppress bounds checking on arrays”, but do not allow a finer level of control. For example, when only global instructions are available, it is not possible for a programmer to identify a particular loop that should be optimized, or a particular array for which bounds checking should be suppressed. A few tools allow detailed control of implementation, but do so by requiring that the programmer embed “implementation comments” in the program near the construct whose implementation is to be tailored. Such comments obscure the meaning of the program, making it difficult to understand and modify. This is a particular concern when (as is typically the case) the program is large or complex, is to be modified by a number of programmers, and must be maintained and enhanced over a number of years. To avoid this problem, a tool might allow the comments to be stored in a “side file” instead of being embedded directly in the program. Unfortunately, this burdens the programmer with the job of identifying the program construct to which each implementation comment applies. Moreover, each change to the program potentially requires a corresponding manual change to the side file so the two stay synchronized. Whether implementation comments are embedded directly in a program or isolated in a side file, there is another problem: the programmer has a difficult time knowing what sorts of implementation comments are allowed, and what syntax they must be expressed in.
Given these and other inherent drawbacks, there is a need for a more efficient method and system for annotating computer program code with instructions describing details of implementation.
While the above discussion is framed in terms of computer programs, the same problems arise when electronic designs are specified using hardware definition languages (HDLs). Here too the designer would like a fine degree of control over the implementation, and until now has had only global and awkward mechanisms for controlling implementation.